<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="utf-8">
    <title>{:lang('图片上传')}</title>
    <style type="text/css">
    html,body{margin:0;padding:0;width:{$width+1}px;height:{$height+1}px;}
    .uploadpic{position:relative;cursor:pointer;width:{$width+1}px;height:{$height+1}px;}
    #ImgPr{border:0;cursor:pointer;}
    .puloadpic{position:absolute;width:{$width+1}px;height:{$height+1}px;}
    .inputfile{position:absolute;top:0px;left:0px;z-index:100;-moz-opacity:0.3;opacity:0.3;filter: alpha(opacity=30);background:#eeeeee;border:1px solid #888;cursor:pointer;}
    #uploadicon{font-size:200px;overflow:hidden;display:block;width:{$width}px;height:{$height}px;-moz-opacity:0.0;opacity:0.0;filter:alpha(opacity=0);cursor:pointer;}
    .uploadtext{position:absolute;top:0px;left:0px;z-index:20;color:#333;font-weight:bold;text-align:center;width:{$width}px;height:{$height}px;line-height:{$height}px;overflow:hidden;}
    .inputfile:hover{border:1px solid #ffb44b;cursor:pointer;}
	</style>
		<script type="text/javascript">
			window.jQuery || document.write("<script src='/static/admin/js/jquery-1.11.3.min.js'>"+"<"+"/script>");
			if('ontouchstart' in document.documentElement) document.write("<script src='/static/admin/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
</head>

<body>
    <form enctype="multipart/form-data" id="uploadpic" action="{:url('admin/upload/uploadpic')}" method="post" name="uploadpic">
        <input type="hidden" value="{$width}" name="width">
        <input type="hidden" value="{$height}" name="height">
        <input type="hidden" value="{$name}" name="field">
        <div class="uploadpic">
    		{notempty name="url"}
        <img id="ImgPr" src="{$url}"  width="{$width}" height="{$height}">
        {/notempty}
        <div class="uploadtext">+</div>
			<div class="inputfile" title="{:lang('点击上传图片')}">
				<input type="file" name="{$name}" id="uploadicon" value="upload"/>
			</div>
		</div>

    </form>
    <script>
        $('#uploadicon').on("change",function(){
           $('#uploadpic').submit();
        })
       $('#{$name}',parent.document).val("{$url}");
       {if $msg !=''}alert('{:lang($msg)}');{/if}
    </script>
</body>

</html>
